package com.quanyan.riding.service.impl;

import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.quanyan.api.APIResponse;
import com.quanyan.riding.entity.db.TbRidingVoice;
import com.quanyan.riding.entity.db.TbRidingVoiceExample;
import com.quanyan.riding.mapper.TbRidingVoiceMapper;
import com.quanyan.riding.service.RidingVoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xian-guo
 * @email 498152332@qq.com
 * @date 2016/9/1.
 */
@Service("ridingVoiceService")
public class RidingVoiceServiceImpl implements RidingVoiceService {

    private static final Logger LOGGER = LoggerFactory.getLogger(RidingVoiceServiceImpl.class);

    /**
     * 语音提示
     */
    @Autowired
    private TbRidingVoiceMapper tbRidingVoiceMapper;

    /**
     * 根据路书编号查询对应的语音提示信息
     * @param pathId
     * @return
     */
    @Override
    public APIResponse<List<TbRidingVoice>> getRidingVoiceMessage(int pathId) {
        TbRidingVoiceExample tbRidingVoiceExample=new TbRidingVoiceExample();
        tbRidingVoiceExample.createCriteria().andPathIdEqualTo((byte) pathId);
        return APIResponse.returnSuccess(tbRidingVoiceMapper.selectByExample(tbRidingVoiceExample));
    }
}
